package com.huiren.ui.importUI;

import java.awt.Color;

import javax.annotation.PostConstruct;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;

@Component
public class MainJFrame extends JFrame {
	public MainJFrame() {

	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JDesktopPane desk = null;

	@Autowired
	private NetImportJPanel netImportJPanel;

	@Autowired
	private XmlImportJPanel xmlImportJPanel;

	@Autowired
	private XMLExportJPanel xmlExportJPanel;

	@Autowired
	private DataSearchJPanel dataSearchJPanel;

	@PostConstruct
	public void initMethod() {
		this.getContentPane().setLayout(new BorderLayout(0, 0));
		this.setBounds(100, 100, 730, 500);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		desk = new JDesktopPane();
		desk.setVisible(true);
		desk.setBackground(Color.WHITE);
		this.getContentPane().add(desk);

		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(0, 0, 670, 420);
		tabbedPane.add("文件导入", xmlImportJPanel);
		tabbedPane.add("网络导入", netImportJPanel);
		tabbedPane.add("数据查询", dataSearchJPanel);
		tabbedPane.add("数据导出", xmlExportJPanel);
		desk.add(tabbedPane);
		this.setVisible(true);
	}

	public JDesktopPane getDesk() {
		return desk;
	}

	public void setDesk(JDesktopPane desk) {
		this.desk = desk;
	}

}
